#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Create by zhang
# Create on 2022/6/22 10:50
from enum import IntEnum
from typing import List, Dict


class PeriodEnum(IntEnum):
    first_quarter = 1
    half_year = 2
    three_quarter = 3
    year = 4
    all = 5

    @classmethod
    def get_values(cls) -> List[int]:
        return list(cls.get_name_value().values())

    @classmethod
    def get_keys(cls) -> List[int]:
        return list(cls.get_name_value().keys())

    @classmethod
    def get_name_value(cls) -> Dict[str, int]:
        return {
            cls.first_quarter.name: cls.first_quarter.value,
            cls.half_year.name: cls.half_year.value,
            cls.three_quarter.name: cls.three_quarter.value,
            cls.year.name: cls.year.value
        }

    @classmethod
    def get_instance_dict(cls):
        return {
            cls.first_quarter.name: cls.first_quarter,
            cls.half_year.name: cls.half_year,
            cls.three_quarter.name: cls.three_quarter,
            cls.year.name: cls.year
        }